<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html class="x-admin-sm">
    
    <head>
        <meta charset="UTF-8">
        <title>家政管理系统-V6.8</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="${pageContext.request.contextPath}/static/branch_oa/css/font.css">
        <link rel="stylesheet" href="${pageContext.request.contextPath}/static/branch_oa/css/xadmin.css">
        <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
        <script type="text/javascript" src="${pageContext.request.contextPath}/static/branch_oa/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="${pageContext.request.contextPath}/static/branch_oa/js/xadmin.js"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
            <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
            <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="layui-fluid">
            <div class="layui-row">
                <form class="layui-form">
                    <input type="hidden" name="id" value="${cardStrip.id}">
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="name" class="layui-form-label">
                          客户姓名
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="name" name="name" required="" lay-verify="name" value="${cardStrip.name}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="tel" class="layui-form-label">
                          联系方式                      
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="tel" name="tel" required="" lay-verify="tel" value="${cardStrip.tel}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>

                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="num" class="layui-form-label">
                          派单号
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="num" name="serialnumber" required="" lay-verify="num" value="${cardStrip.serialnumber}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>

                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="cardnum" class="layui-form-label">
                          卡号
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="cardnum" name="cardid" required="" lay-verify="cardnum"  value="${cardStrip.cardid}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="endtime" class="layui-form-label">
                          结算日期
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="endtime" name="period" required="" lay-verify="endtime"
                                 value='<fmt:formatDate value="${cardStrip.period}" pattern="yyyy-MM-dd" />'
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                    <div class="layui-form-item" style="display: inline-block;">
                        <label for="price" class="layui-form-label">
                           单价
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="price" name="unitprice" required="" lay-verify="price" value="${cardStrip.unitprice}"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="ytime" class="layui-form-label">
                          可用工时/现金
                      </label>
                      <c:if test="${cardStrip.cardtype == 0}">
                          <div class="layui-input-inline">
                              <input type="text" id="stime3" name="yworkinghours" required="" lay-verify="stime" value="${cardStrip.yworkinghours}"
                                     autocomplete="off" class="layui-input">
                          </div>
                      </c:if>
                      <c:if test="${cardStrip.cardtype == 1}">
                          <div class="layui-input-inline">
                              <input type="text" id="stime4" name="ybalance" required="" lay-verify="stime" value="${cardStrip.ybalance}"
                                     autocomplete="off" class="layui-input">
                          </div>
                      </c:if>
                      <c:if test="${cardStrip.cardtype == null}">
                          <div class="layui-input-inline">
                              <input type="text" id="stime5" name="yworkinghours" required="" lay-verify="stime"
                                     autocomplete="off" class="layui-input">
                          </div>
                      </c:if>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="stime" class="layui-form-label">
                          剩余工时/现金
                      </label>
                       <c:if test="${cardStrip.cardtype == 0}">
                           <div class="layui-input-inline">
                               <input type="text" id="stime" name="nworkinghours" required="" lay-verify="stime" value="${cardStrip.nworkinghours}"
                                      autocomplete="off" class="layui-input">
                           </div>
                       </c:if>
                      <c:if test="${cardStrip.cardtype == 1}">
                          <div class="layui-input-inline">
                              <input type="text" id="stime1" name="nbalance" required="" lay-verify="stime" value="${cardStrip.nbalance}"
                                     autocomplete="off" class="layui-input">
                          </div>
                      </c:if>
                      <c:if test="${cardStrip.cardtype == null}">
                          <div class="layui-input-inline">
                              <input type="text" id="stime7" name="nworkinghours" required="" lay-verify="stime"
                                     autocomplete="off" class="layui-input">
                          </div>
                      </c:if>

                  </div>

                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="area" class="layui-form-label">
                          建筑面积                     
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="area" name="builtuparea" required="" lay-verify="area" value="${cardStrip.builtuparea}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="room" class="layui-form-label">
                          几房几厅                    
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="room" name="roomsandhalls" required="" lay-verify="room" value="${cardStrip.roomsandhalls}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="cost" class="layui-form-label">
                          钟点工价                    
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="cost" name="hourlyrate" required="" lay-verify="cost" value="${cardStrip.hourlyrate}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="floor" class="layui-form-label">
                          木质地板                    
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="floor" name="woodenfloor" required="" lay-verify="floor" value="${cardStrip.woodenfloor}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="sofa" class="layui-form-label">
                          沙发配置                    
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="sofa" name="sofaconfiguration" required="" lay-verify="sofa" value="${cardStrip.sofaconfiguration}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="sfloor" class="layui-form-label">
                          实地板                    
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="sfloor" name="solidfloor" required="" lay-verify="sfloor" value="${cardStrip.solidfloor}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="carpet" class="layui-form-label">
                         地毯配置                    
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="carpet" name="carpetconfiguration" required="" lay-verify="carpet"  value="${cardStrip.carpetconfiguration}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="analysis" class="layui-form-label">
                          客户分析                    
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="analysis" name="customeranalysis" required="" lay-verify="analysis" value="${cardStrip.customeranalysis}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                    <div class="layui-form-item" style="display: inline-block;">
                        <label for="analysis" class="layui-form-label">
                            客户分类
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="analysis1" name="customerclassification" required="" lay-verify="analysis" value="${cardStrip.customerclassification}"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>

                  <div class="layui-form-item" style="display: inline-block;">
                      <label for="address" class="layui-form-label">
                          详细地址                      
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="address" name="detailedaddress" required="" lay-verify="address" value="${cardStrip.detailedaddress}"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  
                  <div class="layui-form-item layui-form-text">
                      <label for="desc" class="layui-form-label">备注</label>
                      <div class="layui-input-block">
                          <textarea placeholder="暂无备注" id="desc" name="remarks" class="layui-textarea" >${cardStrip.remarks}</textarea>
                      </div>
                  </div>

                    <div class="layui-form-item" style="display: inline-block;" >
                        <label for="desc" class="layui-form-label">二级密码</label>
                        <div class="layui-input-inline">
                            <input type="text" id="analysis" name="fit" required="" lay-verify="analysis"
                                   autocomplete="off" class="layui-input">
                        </div>

                    </div>

                  <div class="layui-form-item">
                      <label for="L_repass" class="layui-form-label">
                      </label>
                      <button  class="layui-btn" lay-filter="add" lay-submit="">
                          修改
                      </button>
                  </div>
              </form>
            </div>
        </div>
        <script type="text/javascript" src="${pageContext.request.contextPath}/static/branch_oa/js/xcity.js"></script>
        <script>

        layui.use(['laydate','form'], function(){
        var laydate = layui.laydate;
        var form = layui.form;
        
        //执行一个laydate实例
        laydate.render({
          elem: '#starttime' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
          elem: '#endtime' //指定元素
        });
      });
       
        layui.use(['form', 'layer'],

            
            function() {
                $ = layui.jquery;
                var form = layui.form,
                layer = layui.layer;


                //监听提交
                form.on('submit(add)',
                    function(data) {
                        $.ajax({
                            url: "${pageContext.request.contextPath}/cardstrip/updateCardStripByid",
                            data:data.field,
                            success: function (res) {
                                if(res){
                                    layer.alert("修改成功", {
                                        icon: 6
                                    }, function() {
                                        //关闭当前frame
                                        xadmin.close();
                                        // 可以对父窗口进行刷新
                                        xadmin.father_reload();


                                    });
                                }else{
                                    layer.alert("修改失败,或因二级密码验证失败", {
                                        icon: 5
                                    }, function() {
                                        //关闭当前frame
                                        xadmin.close();
                                        // 可以对父窗口进行刷新
                                        xadmin.father_reload();
                                    });
                                }
                            }
                        });
                        return false;
                    });


            });</script>
        <script>var _hmt = _hmt || []; (function() {
                var hm = document.createElement("script");
                hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(hm, s);
            })();</script>
    </body>

</html>
